package com.xframe.common.core.export;

import com.xframe.common.core.constant.ExportFormat;

public class FactoryByExportFormat {

    public static IBuilderFileTo create(ExportFormat exportFormat){
        IBuilderFileTo builderFileTo = null;
        switch (exportFormat){
            case PDF:
                builderFileTo = new BuilderFileToPdf();
                break;
            case DOCX:
                builderFileTo = new BuilderFileToWord();
                break;
            case XLSX:
                builderFileTo = new BuilderFileToExcel();
                break;
            case CSV:
                builderFileTo = new BuilderFileToCsv();
                break;
            default:
                builderFileTo = new BuilderFileToExcel();
                break;
        }
        return builderFileTo;
    }
}
